package com.wuxuehua.myapp.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * User: 吴学华
 * Date: 17-10-24
 * Time: 上午11:53
 */

@Controller
public class MyEventPublisher {

    @Autowired
    ApplicationEventPublisher applicationEventPublisher;

    public void send (){
        for (int i = 0; i < 100; i++) {
            applicationEventPublisher.publishEvent(new MyEvent(this,"测试spring 事件"+i));
        }
    }

}
